struct ListNode* deleteDuplicates(struct ListNode* head)
{
  if(head==NULL||head->next==NULL)
  return head;
  struct ListNode* tmp=malloc(sizeof(struct ListNode));
  tmp->val=1;
  tmp->next=head;
  struct ListNode* q=tmp;
  int x=0;


while(q->next!=NULL&&q->next->next!=NULL)
    if(q->next->val==q->next->next->val)
    {
        x=q->next->val;
        while(q->next!=NULL&&q->next->val==x)
        {
            q->next=q->next->next;
        }
    }
    else
    {
        q=q->next;
    }
}
return tmp->next;
}